<%= render :partial => "header" %>
<p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
	<tr>

		<td valign="top">
			
			<% if @user.profile %>
				<div class="bio">
				<%= @user.profile.bio_html %>
				</div>
			<% end %>
			
			<% if @priorities.any? %>
				<% if @user.endorsements_count > 5 %>
					<div class="heading"><%= link_to t('users.priorities.top5.more', :priority_count => @user.endorsements_count), priorities_user_path(@user) %></div>
				<% else %>
					<div class="heading"><%= t('users.priorities.top5', :count => @priorities.length) %></div>
				<% end %>
				<table border="0" cellspacing="0" cellpadding="0">
				<% for p in @priorities %>
					<% if @endorsements %>
						<% endorsement = @endorsements.detect {|e| e.priority_id == p.priority_id } %>
					<% end %>
					<tr>
						<td valign="top" align="right" width="15">
							<div class="priority_position"><%= p.position %></div>
						</td>
						<td valign="top" style="padding-left: 8px;">
						<div id="priority_<%= p.priority_id %>" class="priority_listing">
							<div class="point_name" id="priority_<%= p.priority_id %>_name">
								<% if p.value < 0 %><span class="opposed"><%= t('oppose.ed')%></span><% end %>
								<%= link_to_unless_current h(p.priority.name), p.priority, :class => "priority_name_link" %>
							</div>						
							<%= render :partial => "priorities/action_show", :locals => {:priority => p.priority, :endorsement => endorsement }%>
						</div>
						</td>
					</tr>
				<% end %>
				</table>
				<p>
			<% end %>
			
			<%= render :partial => "bulletins/form", :locals => {:activity => Activity.new, :comment => Comment.new } %>
			
			<div id="activities">
			<% for activity in @activities %>
				<%= render :partial => "activities/show", :locals => {:activity => activity, :suffix => "_nouser"} %>
			<% end %>
			</div>
			<p>
			<% if @activities.total_pages > 1 %>
				<%= will_paginate(@activities, :params => {:action => "activities"} ) %>
			<% end %>
			
		</td>
		<td valign="top" width="160" style="padding-left: 20px;">
			
			<%= render :partial => "left_nav" %>
			
		</td>
		
	</tr>
</table>